package com.yfux._05_tlias.mapper;

import com.yfux._05_tlias.pojo.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeptMapper {
    @Select("select * from dept")
    List<Dept> list();

    @Delete("delete from dept where id=#{id}")
    Integer deleteById(Integer id);

    @Insert("insert into dept(id, name, create_time, update_time) values(null,#{name},#{createTime},#{updateTime})")
    Integer insert(Dept dept);

    @Select("select * from dept where id=#{id}")
    Dept findById(Integer id);

    Integer update(Dept dept);
}
